#include "CacheUtils.h"
#include "config.h"
#include "trace.h"
#define DEBUG

int main(int argc, char **argv)
{
	instruction currentInstr;
	results_s results;
	unsigned long numInstr=0;

	initResults(&results);
	/*Begin Simulation*/
	printf("ECEE 4593 Cache Simulator Project\n");
	if (readConfigFile("./src/parameters.conf") != 0)
	{
		return 1;
	}
	if (openTraceFile("./short-traces/I1") != 0)
	{
		return 1;
	}


	while(getInstruction(&currentInstr,&results) == 0)
	{
#if defined(DEBUG)
		printInstruction(&currentInstr);
		numInstr++;
#endif /*DEBUG*/

	}
	printResults(&results);
	printf("\n===============================================\n");
	printf("\nCACHE SIMULATION COMPLETE\n");
	printf("\n===============================================\n");
	return 0;
}
